<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="../css/uploadify.css">
<link rel="stylesheet" href="../css/main.css">
<link rel="stylesheet" href="../css/bootstrap.min.css">
<link rel="stylesheet" href="../css/highlight.css">
<link rel="stylesheet" href="../css/mediaelementplayer.css">

<script type="text/javascript" src="../js/jquery.js"></script>
<script type="text/javascript" src="../js/bootstrap.min.js"></script>
<title>${title}</title>
</head>
<body>
	<table class="table">
		<caption>添知网企业信息</caption>
		<thead>
			<tr>
				 
				<th>企业名称</th>
				<th>企业状态</th>
				<th>企业所有人</th>
				<th>申请日期</th>
				<th>申请人</th>
				<th>申请人电话</th>
				<th>申请人证件</th>
				<th>批准申请</th>
			</tr>
		</thead>
		<c:forEach var="corp" items="${corplist}">
			<tbody>
				<tr>
					<td>${corp.corpName}</td>
					<td><c:if test="${corp.status=='active'}">已激活</c:if>
						<c:if test="${corp.status=='rejected'}">申请被拒绝</c:if>
						<c:if test="${corp.status=='Applying'}">申请加入</c:if></td>
						<td>${corp.corpOwner}</td>
					<td><fmt:formatDate value="${corp.dateCreate}"
							pattern="yyyy年MM月dd日 " /></td>
							<td>${corp.creatorName}</td>
							<td>${corp.creatorPhone}</td>
							<td>${corp.creatorID}</td>
					<td><c:if test="${corp.status=='Applying'}">
							<button type="button" class="btn btn-default"
								onClick="updateCorp(${corp.corpCode},'active')">批准加入</button>
							<button type="button" class="btn btn-default"
								onClick="updateCorp(${corp.corpCode},'rejected')">拒绝加入</button>
						</c:if></td>
				</tr>
			</tbody>
		</c:forEach>


	</table>
	<script>
 function updateCorp(corpCode,status){
	 alert(corpCode+'---'+status); 
	 var url="/tztz/updatecorp";
	 var param = new Object();
	 param.clientID=corpCode;
	 param.status=status;
	  
	 var oo = {};
	 oo.url=url;
	 oo.params=JSON.stringify(param);
	 oo.success=function(data){
	  window.location.refresh();
	 };
	 oo.error=function(){
		 alert("系统错误，更新失败");
	 }
	 sendRequest(oo);
 }
</script>
</body>
</html>